package com.ruoyi.riskAssessment.service.impl;

import java.util.List;

import com.ruoyi.riskAssessment.vo.RiskAssessmentProgramInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.riskAssessment.mapper.RiskAssessmentProgramInfoMapper;
import com.ruoyi.riskAssessment.domain.RiskAssessmentProgramInfo;
import com.ruoyi.riskAssessment.service.IRiskAssessmentProgramInfoService;

/**
 * 危险源-事故发生的可能性(L)Service业务层处理
 *
 * @author lth
 * @date 2023-12-15
 */
@Service
public class RiskAssessmentProgramInfoServiceImpl implements IRiskAssessmentProgramInfoService
{
    @Autowired
    private RiskAssessmentProgramInfoMapper riskAssessmentProgramInfoMapper;

    /**
     * 查询危险源-事故发生的可能性(L)
     *
     * @param id 危险源-事故发生的可能性(L)主键
     * @return 危险源-事故发生的可能性(L)
     */
    @Override
    public RiskAssessmentProgramInfo selectRiskAssessmentProgramInfoById(Long id)
    {
        return riskAssessmentProgramInfoMapper.selectRiskAssessmentProgramInfoById(id);
    }

    /**
     * 查询危险源-事故发生的可能性(L)列表
     *
     * @param riskAssessmentProgramInfo 危险源-事故发生的可能性(L)
     * @return 危险源-事故发生的可能性(L)
     */
    @Override
    public List<RiskAssessmentProgramInfo> selectRiskAssessmentProgramInfoList(RiskAssessmentProgramInfo riskAssessmentProgramInfo)
    {
        return riskAssessmentProgramInfoMapper.selectRiskAssessmentProgramInfoList(riskAssessmentProgramInfo);
    }

    /**
     * 新增危险源-事故发生的可能性(L)
     *
     * @param riskAssessmentProgramInfo 危险源-事故发生的可能性(L)
     * @return 结果
     */
    @Override
    public int insertRiskAssessmentProgramInfo(RiskAssessmentProgramInfo riskAssessmentProgramInfo)
    {
        return riskAssessmentProgramInfoMapper.insertRiskAssessmentProgramInfo(riskAssessmentProgramInfo);
    }

    /**
     * 修改危险源-事故发生的可能性(L)
     *
     * @param riskAssessmentProgramInfo 危险源-事故发生的可能性(L)
     * @return 结果
     */
    @Override
    public int updateRiskAssessmentProgramInfo(RiskAssessmentProgramInfo riskAssessmentProgramInfo)
    {
        return riskAssessmentProgramInfoMapper.updateRiskAssessmentProgramInfo(riskAssessmentProgramInfo);
    }

    /**
     * 批量删除危险源-事故发生的可能性(L)
     *
     * @param ids 需要删除的危险源-事故发生的可能性(L)主键
     * @return 结果
     */
    @Override
    public int deleteRiskAssessmentProgramInfoByIds(Long[] ids)
    {
        return riskAssessmentProgramInfoMapper.deleteRiskAssessmentProgramInfoByIds(ids);
    }

    /**
     * 删除危险源-事故发生的可能性(L)信息
     *
     * @param id 危险源-事故发生的可能性(L)主键
     * @return 结果
     */
    @Override
    public int deleteRiskAssessmentProgramInfoById(Long id)
    {
        return riskAssessmentProgramInfoMapper.deleteRiskAssessmentProgramInfoById(id);
    }

    /**     通过schemeId获取List列表
    * @Author lth
    * @Description //TODO
    * @Date 16:40 2023/12/15
    * @Param
    * @return
     **/
    @Override
    public List<RiskAssessmentProgramInfo> listById(RiskAssessmentProgramInfoVo vo) {
        Long schemeId = vo.getSchemeId();
        List<RiskAssessmentProgramInfo> riskAssessmentProgramInfoList = riskAssessmentProgramInfoMapper.listById(schemeId);
        return riskAssessmentProgramInfoList;
    }
}
